package myalg.singleton;

/**
 * @author Pavel Belevich
 *         Date: Jun 29, 2012
 *         Time: 2:13:06 PM
 */
public class VolatileDCLFactory {

    private volatile Singleton instance;

    public Singleton get() {
        if (instance == null) {
            synchronized (this) {
                if (instance == null) {
                    instance = new DefaultSingleton();
                }
            }
        }
        return instance;
    }

}
